<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>错误测试</title>
    <style>
    </style>
</head>

<body>

    <button onclick="error()">这是一个按钮，点击会报错</button>
    <button onclick="fun1()">这是一个按钮，正确按钮</button>


</body>

<script>
    function error(){
        const a = null;
        console.log(a.name)
    }

    function fun1(){
        console.log('正确')
    }

    let i = 1;
    setInterval(function(){
        i++;

        if(i%10 === 0){
            throw new Error()
        }

        console.log(i)


    }, 1000)
</script>

</html>
